package servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.EmployeeService;
import serviceImpl.EmployeeServiceImpl;

/**
 * 	
 */
public class EmployeeDeleteServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	EmployeeService employeeService=new EmployeeServiceImpl();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String empId = request.getParameter("empId");
		employeeService.deleteEmployee(Integer.parseInt(empId));
		request.getRequestDispatcher("/EmployeeListJumpServlet").forward(request, response);
	}

}
